package com.gpslw.mvc.type;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.apache.commons.lang3.reflect.TypeUtils;
import org.springframework.core.GenericTypeResolver;
import org.springframework.core.ResolvableType;
import org.springframework.util.ReflectionUtils;

import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.List;

public class TypeResolve<K, V> {

     private List<Integer> list;

     K key;

     V[] value;

     List<? extends Number> eField;

     List<? super Integer> sField;

//
//    public static void main(String[] args) throws NoSuchFieldException {
//        Class<TypeResolveImpl> typeResolveClass = TypeResolveImpl.class;
//        Field field = ReflectionUtils.findField(typeResolveClass,"list");
//        Field key = ReflectionUtils.findField(typeResolveClass, "key");
//        Field value = ReflectionUtils.findField(typeResolveClass, "value");
//        Field eField = ReflectionUtils.findField(typeResolveClass, "eField");
//        Field sField = ReflectionUtils.findField(typeResolveClass,"sField");
//
//        ResolvableType resolvableType = ResolvableType.forField(field);
//        ResolvableType keyType = ResolvableType.forField(key);
//        ResolvableType valueType = ResolvableType.forField(value);
//        ResolvableType eFieldType = ResolvableType.forField(eField);
//        ResolvableType sFieldType = ResolvableType.forField(sField);
//
//        GenericTypeResolver.getTypeVariableMap(typeResolveClass);
//        GenericTypeResolver.resolveType(key.getGenericType(), typeResolveClass);
//
//        System.out.println("=======");
//
//
//    }
}
